class Storage {
    setCache(name , data){
        try {
            uni.setStorageSync(name, data)
        } catch (err) {
            console.log(err);
        }
    }
    //从本地缓存中读取置顶name对应的内容
	getCache(name) {
		let data;
		try {
			data = uni.getStorageSync(name);
		} catch (e) {
			console.log(e);
		}
		return data;
	}

	//从本地缓存中移出指定key
	removeCache(name) {
		try {
			uni.removeStorageSync(name);
		} catch (e) {

			console.log(e);
		}
	}
    //清除本地数据缓存
	clearCache(){
		try{
			uni.clearStorageSync();
		}catch(e){
			console.log(e)
		}
	}
}

export default new Storage()